package com.keepsport.keepsportapi.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.keepsport.keepsportapi.dao.CourseDao;
import com.keepsport.keepsportapi.entity.Course;
import com.keepsport.keepsportapi.service.intf.CourseService;
import com.keepsport.keepsportapi.vo.R;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class CourseServiceImpl implements CourseService {
    @Resource
    private CourseDao dao;
    @Override
    public R courseAll() {

            QueryWrapper<Course> QueryWrapper = new QueryWrapper<>();
            List<Course> courses = dao.selectList(QueryWrapper);

            if(courses != null) {

               return  R.ok(courses);
            }
        return R.fail();
    }
}
